﻿@using KMF.Utility
@using KMF.WebUI.CustomHelpers
@using KMF.WebUI.Models
@model List<KMF.Common.ProductRateByCateTopListPagingDto>
<div class="home_product_title"><span>Hàng Mới Về</span> <span class="product_count">(20 sản phẩm)</span></div>
<div class="carousel">
    @if (Model.Any())
    {
        <ul class="bxcarousel">

            @foreach (var item in Model)
            {

                var pDetailLink = Url.Action("Index", "ProductDetail", new { productId = item.Id, productName = StringUtil.RemoveSpecialCharactersVn(item.Name) });
                using (Html.BeginForm("DiscountProduct", "Home", FormMethod.Post))
                {
                <li>

                    @Html.Hidden("productId", item.Id)
                    @Html.Hidden("productIdRoot", item.Id)
                    @Html.Hidden("productImagePath", item.ImagePath)
                    @Html.Hidden("rootPriceProduct", item.Price)
                    @Html.Hidden("promotionPrice", item.PromotionPrice)
                    <input type="hidden" name="productName" id="productName" value="@item.Name" />
                    <input type="hidden" value="1" name="productQuantity" id="productQuantity" />
                    @Html.Hidden("productStatus", item.ProductStatus)
                    @Html.Hidden("productColor")
                    @Html.Hidden("productColorCode")
                    @Html.Hidden("productSizeId")
                    @Html.Hidden("productSizeName")
                    @Html.Hidden("productSizePrice")
                    @Html.Hidden("promotionPercent", item.DiscountPercentage)
                    @Html.Hidden("decreasePrice", item.DiscountAmount)
                    @Html.Hidden("providerName", item.ProviderName)
                    @Html.Hidden("categoryId", item.CategoryId)
                    <div class="home_image">
                        <a href="@pDetailLink">
                            <img src="@item.ImagePath.ImagePathThumb(159, 243)" width="159" height="243" alt="@item.Name" class="lzLoading"/></a>
                        @if (item.PromotionPrice > 0)
                        {
                            <span class="product_discount">-@item.DiscountPercentage.ToString("#.#")%</span>
                        }

                    </div>
                    <a class="product_title" href="@pDetailLink">@item.Name</a>
                    <span class="home_price">@item.Price.ToString("##,###,###") đ</span>
                    <input type="submit" class="home_cart" /><a href="@pDetailLink" class="home_readmore"></a>
                </li>
                }
            }
        </ul>
    }
    <a href="@Url.Action("ALLNewProduct", "Home", new { })" class="home_read_all">Xem tất cả hàng mới về &gt;</a>
</div>

